UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F4Sw2ZJJU4adzVYeOlCyBxkkBvSprmaT3PQOAytsWys='
WHERE
key_id = 'a75b542426a5d2789d562f7388b81460e62f6f5eca9a959eeb96be9021ffcb5a'
AND (
token = 'F4Sw2ZJJU4adzVYeOlCyBxkkBvSprmaT3PQOAytsWys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)