UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n7Ja0rQkV+Uv8mnVhHaCWc7HVQXFHlBAHT/X8toN4HY=' 
WHERE 
  key_id = '8c4637bc2e8289f0fe67f42275dc020c46486027edc4a52473ab84de1426c674' 
  AND (
    token = 'n7Ja0rQkV+Uv8mnVhHaCWc7HVQXFHlBAHT/X8toN4HY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033