UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'js0Ey3F6jXsrJwGKJs6ipJHqP+HJQzVF6Axa/VZQNzM='
WHERE
key_id = '362b73d13320274b0d7969242d82f9fc07699fc5d8d69cf7bfb8ad3ba207ae07'
AND (
token = 'js0Ey3F6jXsrJwGKJs6ipJHqP+HJQzVF6Axa/VZQNzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)