UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vIDNB6RYC0K4SE3/pKB1b709FHULBj5gNkbQP5Jx2Ds='
WHERE
key_id = 'd23be9c2826c64935c9e9067d16ae085b52c02e3fe5206594bd9f47374233b32'
AND (
token = 'vIDNB6RYC0K4SE3/pKB1b709FHULBj5gNkbQP5Jx2Ds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)