UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LHd7+SI3lIvofVHa+IpU+llrtcX3WYmP8NuPi4UbZUc='
WHERE
key_id = 'aeafa126d98485c57fdf75344e141e6d063e4a4ebf326150284c0afe8c294f67'
AND (
token = 'LHd7+SI3lIvofVHa+IpU+llrtcX3WYmP8NuPi4UbZUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)