UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ao8kLhBTOxSN7NaIYtD5ykRcEszao4BzpJaBIo70uJ8='
WHERE
key_id = '368b1c1c785ef5b939e111f56f8db700bd0373e63c7834341d4ba49fad658b91'
AND (
token = 'Ao8kLhBTOxSN7NaIYtD5ykRcEszao4BzpJaBIo70uJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)