UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pvqguehfhovCUh6zA+bw265nI0Wqd4R2sbAhWVvUJ1Q='
WHERE
key_id = 'e00349fe0a9b25778d4053ed5a638bec372fd6a6d9347b7da3f76f900e1377b7'
AND (
token = 'pvqguehfhovCUh6zA+bw265nI0Wqd4R2sbAhWVvUJ1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)