UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14F55ruyUIxeWqxFSZYIeGPSURUJXmB6N9ai7VdcvNI='
WHERE
key_id = 'c87d3682533368aaedc723112147c0e635f69912f3c3b7d8b736f607568063d1'
AND (
token = '14F55ruyUIxeWqxFSZYIeGPSURUJXmB6N9ai7VdcvNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)