UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eL8O82xU0qvrhBqYYv5rCfOqIbZN90PwzWJbcNm5mTs='
WHERE
key_id = '7c2d597cd849ee986ffb4773bb8ac0482feb46d7c6760a51432dc6b80788343c'
AND (
token = 'eL8O82xU0qvrhBqYYv5rCfOqIbZN90PwzWJbcNm5mTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)