UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vKVdsC3Ft9CL0JKIDGDrUO/I7dSVirboE/nODz0yn6A=' 
WHERE 
  key_id = 'f592d4797deda37931c89a7209c0b2988f256e2d5fa9ccb8f3fcc74bf9fa2b81' 
  AND (
    token = 'vKVdsC3Ft9CL0JKIDGDrUO/I7dSVirboE/nODz0yn6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034