UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VZpNH9t9hhwNlw+vEG/ZZQIUia+3grmRBqm3xQ8aDj0=' 
WHERE 
  key_id = '5136bae7d56ec5d5e18c18c7e7d93e76999d861e25942d2b0ad054570d253a3d' 
  AND (
    token = 'VZpNH9t9hhwNlw+vEG/ZZQIUia+3grmRBqm3xQ8aDj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047