UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b50w2EtT006e/5bGn4CEwYZ8SPIDhWmoGCkII9jV8TI=' 
WHERE 
  key_id = '10bf584b9670aa02cb1b1231785b4cab6425fc2ffb3d70fd522e33e7eb152af3' 
  AND (
    token = 'b50w2EtT006e/5bGn4CEwYZ8SPIDhWmoGCkII9jV8TI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049