UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jqi1JattwIHcMTgNemROffrVI/p3z3w1Fisq7s6UW6M='
WHERE
key_id = '2fd7213b5335130a0817d5c249a90d93ad4f198cc873d3d1ef59c3b7bcf3482b'
AND (
token = 'jqi1JattwIHcMTgNemROffrVI/p3z3w1Fisq7s6UW6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)