UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a9ke7v1rsEbHoFmn2b0j2ifC7jlse2lbxD+pnnIUIgw='
WHERE
key_id = 'c6c622324876caca9abd1435ac81c03d5728e0c50c4bf066b4c62d001f12378b'
AND (
token = 'a9ke7v1rsEbHoFmn2b0j2ifC7jlse2lbxD+pnnIUIgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)