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