UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LEji8JQSufNepKn950cKCJTpvyAk46y/3A9Vcmc90W4='
WHERE
key_id = '2cf2d4b3ffae0bddf4d2be249f23de04894fb9a28afa7a2dcdb0b9df2f059a6d'
AND (
token = 'LEji8JQSufNepKn950cKCJTpvyAk46y/3A9Vcmc90W4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)