UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dF/PFXsfyOs79veEkWHtFYfCW2iGZqMXhIV+57rfYqA=' 
WHERE 
  key_id = '8057c924da6a3267d29a8ea1a30133855102b0e918e91532ae443ce4ae65daa5' 
  AND (
    token = 'dF/PFXsfyOs79veEkWHtFYfCW2iGZqMXhIV+57rfYqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027