UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mn42LbOU+S11JVIHtxDuBIQys42jsVBUQJDsLBmSiCE=' 
WHERE 
  key_id = 'b97201f210fba8de0e432c018f2826d9d29db16d5aa7e4f052953a390496c71e' 
  AND (
    token = 'mn42LbOU+S11JVIHtxDuBIQys42jsVBUQJDsLBmSiCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068