UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4AtvyId0N6PHVICqyjnrikvtZmLdQg2jq02aP7qfyu0='
WHERE
key_id = '81e692103d27d1a88e8673670aef0e240e9dbf6609dc848cdf0352950d0e3622'
AND (
token = '4AtvyId0N6PHVICqyjnrikvtZmLdQg2jq02aP7qfyu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)