UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SwveTKxoTBA4OCFgAuXsIzlJhF76NtWj3exqHVlyzb8=' 
WHERE 
  key_id = '150c48e33b65719d059cead0c6f573772d7ff483fbc6e08380c6ca9c5ed71bd8' 
  AND (
    token = 'SwveTKxoTBA4OCFgAuXsIzlJhF76NtWj3exqHVlyzb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040