UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4kT6nAtZGoeu5QQNKr7SIX6J9IOAEdIhSze2GsJttLc=' 
WHERE 
  key_id = '4ebdfcfb244cfa484a791d5d4c3610f146bbcda56769ea5b70cdcc35dd6c2626' 
  AND (
    token = '4kT6nAtZGoeu5QQNKr7SIX6J9IOAEdIhSze2GsJttLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020