UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kSV5pCWBG31sES/wFX68A/cl728AXzz2ygDP6QFHiLQ='
WHERE
key_id = 'ac9ad25a2c30d95dcc457f06ee5eed8f92dce9228c05deb2411a385f52613ad8'
AND (
token = 'kSV5pCWBG31sES/wFX68A/cl728AXzz2ygDP6QFHiLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)