UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IoZ62IHVOTGwYp2gFrDvCpXgdDfmNnOpEZuG27QAWJo='
WHERE
key_id = '65fb5e58bb03a2214e78c6030a30ed8709b5bd8a7b0152e0f0b60b2745b26965'
AND (
token = 'IoZ62IHVOTGwYp2gFrDvCpXgdDfmNnOpEZuG27QAWJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)