UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R0KNDpV7vF/X5hPjCgys4UC/ELKWuqPMOAVbBdTSDiI='
WHERE
key_id = 'c6d979379e3030f0f9664cfcc4b8e64276ec77848d7cce5c7f64e18aae99b85b'
AND (
token = 'R0KNDpV7vF/X5hPjCgys4UC/ELKWuqPMOAVbBdTSDiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)