UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sAsWy/gJ8LPdjGp7EVV38/bjF0uuXhs3N5fpHv62WW4='
WHERE
key_id = '98100e45b87a52cb9027bb227f10318b4b281e7d1c905ea28cb4bdcd0465d401'
AND (
token = 'sAsWy/gJ8LPdjGp7EVV38/bjF0uuXhs3N5fpHv62WW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)