UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+O+BAIhHYpOlHKmqddyVsYSAzIjdXYu1jb4qGo26sWY='
WHERE
key_id = 'd06c30fd90b18c00e5eff4c56d1bbfdfe670a17f4e93e002ffaeabfe90d83212'
AND (
token = '+O+BAIhHYpOlHKmqddyVsYSAzIjdXYu1jb4qGo26sWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)