UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lxyqABTJHt3weCGrFLQRKskUfOxKsDgEQZgE4bRPSTs='
WHERE
key_id = '4242fc9781368b3f2df286bae470d4de10e1ad1e30d8b98a5c247e7ca344a553'
AND (
token = 'lxyqABTJHt3weCGrFLQRKskUfOxKsDgEQZgE4bRPSTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)