UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uFZP07QcOc53yaNn4mkCOs3CqdF8H5W0gU30Rbs6SLE='
WHERE
key_id = '308bc938468c3ae8459e60c091c77ae6b969d92298b5d0ece3828ce6273683af'
AND (
token = 'uFZP07QcOc53yaNn4mkCOs3CqdF8H5W0gU30Rbs6SLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)