UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gjBHDjqOJ+IT4hOT+Hjaxmf1+J2/syrT35GaYvJNtBQ='
WHERE
key_id = '0bbe414c92fec5f5425fab148b6a37df74c6fa781758ead7c21b3e53da5bc2a2'
AND (
token = 'gjBHDjqOJ+IT4hOT+Hjaxmf1+J2/syrT35GaYvJNtBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)