UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XMrTtc3iIrxBic3kd9+20npWZ21VzRwIqT/J0vhyZfY='
WHERE
key_id = '94e72e8ed24c0420236a785be96b1650ab4858f0e99254d8ab24c427f936a0ae'
AND (
token = 'XMrTtc3iIrxBic3kd9+20npWZ21VzRwIqT/J0vhyZfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)