UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd7m5u0k2MfjKm6A5jNvAb0Efcomu7s3ZSSZKUTiPyF4='
WHERE
key_id = '83ee52ab21c77bda92de375cf05bd77e74816eee622d44d45a3b58ae6e32811f'
AND (
token = 'd7m5u0k2MfjKm6A5jNvAb0Efcomu7s3ZSSZKUTiPyF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)