UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wsy0GFTXb6YX+vMXwAZ90k9xyWNr1JeqMQ7xK25QgGM='
WHERE
key_id = '8fc95ff03d13b1c581725d556f23f8e9262b58aa43beabefb9ede402cb837707'
AND (
token = 'wsy0GFTXb6YX+vMXwAZ90k9xyWNr1JeqMQ7xK25QgGM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)