UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h9P+AlzVGoN9raauVR4jyhczJ/RHYoW1gZaeHSyDOIQ='
WHERE
key_id = 'e1b196d0da73bbbc5840f89ba9ebbb8f61e1772c047ce297094efb9c3254176c'
AND (
token = 'h9P+AlzVGoN9raauVR4jyhczJ/RHYoW1gZaeHSyDOIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)