UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vIAsrKPQv+yUuLe+iyo6maQgVXWLYQp/bHZg+JqmjD0='
WHERE
key_id = '60a2ba1e319a947ef2a129c1be3099454f19fe35622c936b3ee9c323fc1061ff'
AND (
token = 'vIAsrKPQv+yUuLe+iyo6maQgVXWLYQp/bHZg+JqmjD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)