UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ScEY1y5lgovLWun9eoWIs2k2OH7r3LeyUgykMnlGFiQ='
WHERE
key_id = '79cf0b105ed8afc6df3f104c91ffcf7b027d264283e552f605949421f9db9100'
AND (
token = 'ScEY1y5lgovLWun9eoWIs2k2OH7r3LeyUgykMnlGFiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)