UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QfceQ03vLrNG9o/gzOPurW8kUG7VIZt1PAtHKBhpCRc=' 
WHERE 
  key_id = '41572117718d037c3e5a12c9fd6be83f5f49e6e26a2a410fa12725d9256c799c' 
  AND (
    token = 'QfceQ03vLrNG9o/gzOPurW8kUG7VIZt1PAtHKBhpCRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032