UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kLPVSBUsbs07dUnpifvMIXp/1v1Bv6s88Ga3NCRo3ME='
WHERE
key_id = 'b41c7a3341a122fee39ae1c79e029f719a9f8d0bc03a30e0a55cf21640ee7b10'
AND (
token = 'kLPVSBUsbs07dUnpifvMIXp/1v1Bv6s88Ga3NCRo3ME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)